package org.fly.jingwei.dao;

import org.fly.jingwei.entity.JobEntity;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author leo
 * @date 2017/2/15
 */
@Repository
public interface JobDao {

    /**
     *
     * @param start
     * @param limit
     * @param userGroupName
     * @return
     */
    List<JobEntity> getThisPageJob(int start, int limit, String userGroupName);

    /**
     *
     * @param userGroupName
     * @return
     */
    Integer getTotalCount(String userGroupName); //获得总记录数

    /**
     *
     * @param start
     * @param limit
     * @param name
     * @param date
     * @param userGroupName
     * @return
     */
    List<JobEntity> conditionFindJobs(int start, int limit, String name, String date, String userGroupName);//带条件的查询

    /**
     * 带条件查询总记录数
     * @param name
     * @param date
     * @param userGroupName
     * @return
     */
    Integer conditionFindJobCount(String name, String date, String userGroupName);

    /**
     *
     * @param jobId
     * @return
     */
    JobEntity getJobById(Integer jobId);

    /**
     *
     * @param jobName
     * @return
     */
    JobEntity getJobByName(String jobName);

    /**
     *
     * @param oldName
     * @param newName
     */
    void updateJobNameForJob(String oldName, String newName);
}
